using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Proximity
{
    /// <summary>
    /// <para>Near</para>
    /// <para>Calculates distance and additional proximity information between the input features and the closest feature in another layer or feature class.</para>
    /// <para>计算输入要素与另一个图层或要素类中最近要素之间的距离和其他邻近信息。</para>
    /// </summary>    
    [DisplayName("Near")]
    public class Near : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Near()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input features that can be point, polyline, polygon, or multipoint type.</para>
        /// <para>输入要素可以是点、折线、面或多点类型。</para>
        /// </param>
        /// <param name="_near_features">
        /// <para>Near Features</para>
        /// <para>One or more feature layers or feature classes containing near feature candidates. The near features can be point, polyline, polygon, or multipoint. If multiple layers or feature classes are specified, the NEAR_FC field is added to the input table and will store the paths of the source feature class containing the nearest feature found. The same feature class or layer can be used as both input and near features.</para>
        /// <para>一个或多个包含邻近候选要素的要素图层或要素类。近似要素可以是点、折线、面或多点。如果指定了多个图层或要素类，则 NEAR_FC 字段将添加到输入表中，并将存储包含找到的最近要素的源要素类的路径。同一要素类或图层可同时用作输入要素和近要素。</para>
        /// </param>
        public Near(object _in_features, List<object> _near_features)
        {
            this._in_features = _in_features;
            this._near_features = _near_features;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Near";

        public override string CallName => "analysis.Near";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_features, _near_features, _search_radius, _location.GetGPValue(), _angle.GetGPValue(), _out_feature_class, _method.GetGPValue(), _field_names];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input features that can be point, polyline, polygon, or multipoint type.</para>
        /// <para>输入要素可以是点、折线、面或多点类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Near Features</para>
        /// <para>One or more feature layers or feature classes containing near feature candidates. The near features can be point, polyline, polygon, or multipoint. If multiple layers or feature classes are specified, the NEAR_FC field is added to the input table and will store the paths of the source feature class containing the nearest feature found. The same feature class or layer can be used as both input and near features.</para>
        /// <para>一个或多个包含邻近候选要素的要素图层或要素类。近似要素可以是点、折线、面或多点。如果指定了多个图层或要素类，则 NEAR_FC 字段将添加到输入表中，并将存储包含找到的最近要素的源要素类的路径。同一要素类或图层可同时用作输入要素和近要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Near Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _near_features { get; set; }


        /// <summary>
        /// <para>Search Radius</para>
        /// <para>The radius used to search for near features. If no value is specified, all near features are considered. If a distance but no unit or unknown is specified, the units of the coordinate system of the input features are used. If the Geodesic option is used for the Method parameter, use a linear unit such as kilometers or miles.</para>
        /// <para>用于搜索邻近要素的半径。如果未指定值，则考虑所有邻近要素。如果指定了距离但未指定单位或未知数，则使用输入要素坐标系的单位。如果测地线选项用于方法参数，请使用线性单位，例如公里或英里。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_radius { get; set; } = null;


        /// <summary>
        /// <para>Location</para>
        /// <para><xdoc>
        ///   <para>Specifies whether x- and y-coordinates of the closest location of the near feature will be written to the NEAR_X and NEAR_Y fields.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Locations will not be written. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Locations will be written.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将近要素最近位置的 x 坐标和 y 坐标写入 NEAR_X 和 NEAR_Y 字段。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不会写入位置。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将写入位置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Location")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _location_value _location { get; set; } = _location_value._false;

        public enum _location_value
        {
            /// <summary>
            /// <para>LOCATION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("LOCATION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_LOCATION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_LOCATION")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Angle</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the near angle will be calculated and written to a NEAR_ANGLE field in the output table. A near angle measures direction of the line connecting an input feature to its nearest feature at their closest location. When the Planar method is used in the Method parameter, the angle is within the range of -180° to 180°, with 0° to the east, 90° to the north, 180° (or -180°) to the west, and -90° to the south. When the Geodesic method is used, the angle is within the range of -180° to 180°, with 0° to the north, 90° to the east, 180° (or -180°) to the south, and -90° to the west.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The NEAR_ANGLE field will not be added. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The NEAR_ANGLE field will be added.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否计算近角并将其写入输出表中的NEAR_ANGLE字段。近角测量将输入要素连接到其最近位置的最近要素的线的方向。在方法参数中使用平面方法时，角度在 -180° 到 180° 的范围内，东 0°，北 90°，西 180°（或 -180°），南 -90°。使用测地线方法时，角度在 -180° 到 180° 的范围内，北为 0°，东为 90°，南为 180°（或 -180°），西为 -90°。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不会添加NEAR_ANGLE字段。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将添加NEAR_ANGLE字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Angle")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _angle_value _angle { get; set; } = _angle_value._false;

        public enum _angle_value
        {
            /// <summary>
            /// <para>ANGLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ANGLE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ANGLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ANGLE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a shortest path will be used on a spheroid (geodesic) or a flat earth (planar) method. It is recommended that you use the Geodesic method with data stored in a coordinate system that is not appropriate for distance measurements (for example, Web Mercator or any geographic coordinate system) and any analysis that spans a large geographic area.</para>
        ///   <bulletList>
        ///     <bullet_item>Planar—Planar distances will be used between the features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geodesic—Geodesic distances will be used between features. This method takes into account the curvature of the spheroid and correctly deals with data near the dateline and poles.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是在椭球体（测地线）还是平地（平面）方法上使用最短路径。建议将测地线方法用于存储在不适合距离测量（例如，Web 墨卡托或任何地理坐标系）的坐标系中的数据，以及跨越较大地理区域的任何分析。</para>
        ///   <bulletList>
        ///     <bullet_item>平面—将在要素之间使用平面距离。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>测地线—要素之间将使用测地线距离。该方法考虑了椭球体的曲率，并正确处理了日期变更线和极点附近的数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._PLANAR;

        public enum _method_value
        {
            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—Planar distances will be used between the features. This is the default.</para>
            /// <para>平面—将在要素之间使用平面距离。这是默认设置。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic—Geodesic distances will be used between features. This method takes into account the curvature of the spheroid and correctly deals with data near the dateline and poles.</para>
            /// <para>测地线—要素之间将使用测地线距离。该方法考虑了椭球体的曲率，并正确处理了日期变更线和极点附近的数据。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

        }

        /// <summary>
        /// <para>Field Names</para>
        /// <para><xdoc>
        ///   <para>Specifies the names of the attribute fields that will be added during processing.</para>
        ///   <para>If this parameter is not used or any fields that will be added are excluded from this parameter, the default field names will be used.</para>
        ///   <para>By default, NEAR_FID and NEAR_DIST fields will always be added, NEAR_X and NEAR_Y fields will be added when the Location parameter (location in Python) is enabled, the NEAR_ANGLE field will be added when the Angle parameter (angle in Python) is enabled, and the NEAR_FC field will be added when multiple inputs are used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将在处理过程中添加的属性字段的名称。</para>
        ///   <para>如果未使用此参数或从此参数中排除了将要添加的任何字段，则将使用默认字段名称。</para>
        ///   <para>默认情况下，将始终添加 NEAR_FID 和 NEAR_DIST 字段，启用 Location 参数（Python 中的位置）时添加 NEAR_X 和 NEAR_Y 字段，启用 Angle 参数（Python 中的角度）时添加 NEAR_ANGLE 字段，使用多个输入时添加 NEAR_FC 字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Names")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_names { get; set; } = null;


        public Near SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}